<template>
	<view class="page" :style="{'background':`url(${backData.share_poster}),#fff`,}">
		<view class="flex benben-position-layout flex flex-wrap align-center Sharecoupons_flex_0_hiae"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
			<view class='flex flex-wrap align-center justify-between flex-sub Sharecoupons_fd0_0_hiae'>
				<view class='flex flex-wrap align-center Sharecoupons_fd0_0_c0_hiae' @tap.stop="handleJumpDiy"
					data-type="back" data-url="1">
					<text class='fu-iconfont2  Sharecoupons_fd0_0_c0_c0_hiae'>&#xe794;</text>
				</view>
				<view class='flex flex-wrap align-center Sharecoupons_fd0_0_c0_hiae'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<!---flex布局flex布局开始-->
		<!-- <view class="flex flex-wrap align-center justify-around benben-flex-layout Sharecoupons_flex_1_hiae">
			<view class="btn flex justify-center align-center Sharecoupons_fd0_0_c0_c011112222" @click="downApp">
				<image src='/static/images/ios.png' style="width: 26rpx; height: 32rpx; margin-right: 16rpx" mode="">
				</image>
				<text class="Sharecoupons_fd0_0_c0_c011113333">iPhone下载</text>
			</view>
			<view class="btn flex justify-center align-center Sharecoupons_fd0_0_c0_c011112222" @click="downAnd">
				<image src='/static/images/Android.png' style="width: 26rpx; height: 32rpx; margin-right: 16rpx"
					mode="">
				</image>
				<text class="Sharecoupons_fd0_0_c0_c011113333">Android下载</text>

			</view>
		</view> -->
		<!---flex布局flex布局结束-->
		<!---flex布局flex布局开始-->
		<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout Sharecoupons_flex_2_hiae">
			<view class='flex flex-wrap align-center Sharecoupons_fd2_0_hiae'>
				<view class='flex flex-wrap align-center Sharecoupons_fd2_0_c0_hiae'>
					<view
						class='flex flex-direction flex-wrap align-center justify-center Sharecoupons_fd2_0_c0_c0_hiae'>
						<view class='flex align-center'>
							<text class='Sharecoupons_fd2_0_c0_c0_c0_c0_hiae'>￥</text>
							<text class='Sharecoupons_fd2_0_c0_c0_c0_c1_hiae'>{{switchData.money}}</text>
						</view>
						<text class='Sharecoupons_fd2_0_c0_c0_c1_hiae'>{{switchData.min_money_name}}</text>
					</view>
				</view>
				<view
					class='flex flex-direction flex-wrap align-stretch justify-center flex-sub Sharecoupons_fd2_0_c1_hiae'>
					<text class='Sharecoupons_fd2_0_c1_c0_hiae'>{{switchData.name}}</text>
					<text class='Sharecoupons_fd2_0_c1_c1_hiae'>{{switchData.content}}</text>
					<view class='flex flex-wrap align-center Sharecoupons_fd2_0_c1_c2_hiae'>
						<text class='Sharecoupons_fd2_0_c1_c2_c0_hiae'>{{$t('有效期至：')}}</text>
						<text class='Sharecoupons_fd2_0_c1_c2_c0_hiae'>{{switchData.end_time}}</text>
					</view>
				</view>
			</view>
		</view>
		<!---flex布局flex布局结束-->
		<!---flex布局flex布局开始-->
		<view
			class="flex flex-wrap align-center justify-center benben-position-layout flex Sharecoupons_flex_2_hiae00123">
			<view class="btn flex justify-center align-center Sharecoupons_fd0_0_c0_c011112222" @click="downApp">
				<image src='/static/images/ios.png' style="width: 26rpx; height: 32rpx; margin-right: 16rpx" mode="">
				</image>
				<text class="Sharecoupons_fd0_0_c0_c011113333">iPhone下载</text>
			</view>
			<view class="btn flex justify-center align-center Sharecoupons_fd0_0_c0_c01111222222" @click="downAnd">
				<image src='/static/images/Android.png' style="width: 26rpx; height: 32rpx; margin-right: 16rpx"
					mode="">
				</image>
				<text class="Sharecoupons_fd0_0_c0_c011113333">Android下载</text>

			</view>
		</view>
		<view :style="{height: '88rpx'}"></view>
		<!---flex布局flex布局结束-->
	</view>
</template>
<script>
	export default {
		components: {},


		data() {
			return {
				"id": "",
				"switchData": {},
				"backData": {},
				"dataMessage": {},
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {
			let {
				id
			} = options
			if (id !== undefined) this.id = id
			console.log(this.id, '这是分享优惠券id');
			this.getSwitchFunc()
			this.getbackDataFunc()
			this.queryEssayFunc();
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取分享的优惠券
			async getSwitchFunc() {
				//请求方法
				//数据验证

				let dataswitchData = await this.$api.get(global.apiUrls.post683832635ca81, {
					id: this.id
				});

				if (dataswitchData.data.code != 1) {
					this.$message.info(dataswitchData.data.msg);
					return
				}
				let infoswitchData = dataswitchData.data;
				this.switchData = infoswitchData.data
			},
			//获取背景
			async getbackDataFunc() {
				//请求方法
				//数据验证

				let databackData = await this.$api.get(global.apiUrls.post6838171e4f953, {

				});

				if (databackData.data.code != 1) {
					this.$message.info(databackData.data.msg);
					return
				}
				let infobackData = databackData.data;
				this.backData = infobackData.data
			},
			//
			async queryEssayFunc() {
				//请求方法
				//数据验证
				let datadataMessage = await this.$api.get(global.apiUrls.post6717463928b84);
				if (datadataMessage.data.code != 1) {
					this.$message.info(datadataMessage.data.msg);
					return;
				}
				let infodataMessage = datadataMessage.data;
				this.dataMessage = infodataMessage.data;
				console.log(this.dataMessage);
			},
			// 打开/下载App
			downApp() {
				if (!this.dataMessage.ios_urls) {
					uni.showToast({
						icon: "none",
						title: "暂无链接",
					});
					return;
				} else {
					location.href = this.dataMessage.ios_urls;
				}
			},
			//下载链接
			downAnd() {
				if (!this.dataMessage.android_urls) {
					uni.showToast({
						icon: "none",
						title: "暂无链接",
					});
					return;
				} else {
					location.href = this.dataMessage.android_urls;
				}
			},
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(image-path('81.png')) no-repeat;
		background-size: 100% auto !important;
		background-repeat: no-repeat !important;

		.Sharecoupons_flex_2_hiae {
			padding: 32rpx 80rpx 0rpx 80rpx;
			margin: 820rpx 0rpx 0rpx 0rpx;

			.Sharecoupons_fd2_0_hiae {
				height: 200rpx;
				background: rgba(255, 255, 255, 1);
				background-size: 100% auto;
				border-radius: 16rpx;

				.Sharecoupons_fd2_0_c0_hiae {
					background: rgba(255, 101, 89, 1);
					background-size: 100% auto;
					height: 200rpx;
					width: 200rpx;
					border-radius: 16rpx 0rpx 0rpx 16rpx;

					.Sharecoupons_fd2_0_c0_c0_hiae {
						width: 200rpx;

						.Sharecoupons_fd2_0_c0_c0_c0_c0_hiae {
							color: #FFFFFF;
							font-size: 24rpx;
							font-weight: 700;
							line-height: 32rpx;
							margin: 13rpx 0rpx 0rpx 0rpx;
						}

						.Sharecoupons_fd2_0_c0_c0_c0_c1_hiae {
							color: #FFFFFF;
							font-size: 42rpx;
							font-weight: 700;
							line-height: 67rpx;
							-webkit-line-clamp: 1;
							overflow: hidden;
							text-overflow: ellipsis;
							display: -webkit-box;
							-webkit-box-orient: vertical;
						}

						.Sharecoupons_fd2_0_c0_c0_c1_hiae {
							color: #FFFFFF;
							font-size: 24rpx;
							font-weight: 700;
							line-height: 33rpx;
							margin: 7rpx 0rpx 0rpx 0rpx;
							-webkit-line-clamp: 1;
							overflow: hidden;
							text-overflow: ellipsis;
							display: -webkit-box;
							-webkit-box-orient: vertical;
						}
					}
				}

				.Sharecoupons_fd2_0_c1_hiae {
					padding: 0rpx 32rpx 0rpx 32rpx;

					.Sharecoupons_fd2_0_c1_c0_hiae {
						color: #333333;
						font-size: 28rpx;
						font-weight: 700;
						-webkit-line-clamp: 1;
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-box-orient: vertical;
						line-height: 40rpx;
						margin: 16rpx 0rpx 0rpx 0rpx;
					}

					.Sharecoupons_fd2_0_c1_c1_hiae {
						color: #999999;
						font-size: 24rpx;
						font-weight: 400;
						line-height: 33rpx;
						margin: 8rpx 0rpx 8rpx 0rpx;
						-webkit-line-clamp: 1;
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-box-orient: vertical;
					}

					.Sharecoupons_fd2_0_c1_c2_hiae {
						color: #909093;
						font-size: 22rpx;
						line-height: 30rpx;
						font-weight: 400;
						margin: 0rpx 0rpx 16rpx 0rpx;
					}
				}
			}
		}

		.Sharecoupons_fd2_0_c1_c2_c0_hiae {
			color: #666666;
			font-size: 22rpx;
			font-weight: 400;
			line-height: 30rpx;
		}

		.Sharecoupons_flex_1_hiae {
			position: absolute;
			bottom: 140rpx;
			width: 750rpx;
			padding: 0rpx 32rpx 0rpx 32rpx;
		}

		.Sharecoupons_fd1_0_hiae {
			border-radius: 100rpx;
			width: 300rpx;
			line-height: 80rpx;
			font-size: 28rpx;
			background: rgba(255, 255, 255, 1);
			color: rgba(216, 30, 6, 1);
			font-weight: 500;
		}

		.Sharecoupons_flex_0_hiae {
			width: 750rpx;
			height: 88rpx;
			overflow: hidden;
			z-index: 10;
			top: 0rpx;
			background-size: 100% auto;
			background: rgba(255, 255, 255, 0);

			.Sharecoupons_fd0_0_hiae {
				padding: 0rpx 32rpx 0rpx 32rpx;
				height: 88rpx;
			}
		}

		.Sharecoupons_fd0_0_c0_hiae {
			width: 120rpx;
			height: 88rpx;

			.Sharecoupons_fd0_0_c0_c0_hiae {
				font-size: 32rpx;
				color: var(--benbenFontColor3);
			}
		}
	}

	//分享样式
	.wxtip-txt {
		position: fixed;
		height: 100vh;
		width: 100%;
		background: rgba(0, 0, 0, 0.5);
		z-index: 100;
	}

	.wxtip-txt001 {
		position: fixed;
		height: 100vh;
		width: 100%;
		// background: red;
		z-index: 10000;
	}

	.wxtip-icon {
		margin-top: 100rpx;
		margin-left: 40rpx;
	}

	.Sharecoupons_fd0_0_c0_c011112222 {
		background: red;
		height: 80rpx;
		border-radius: 50rpx;
		width: 260rpx;
		margin-right: 80rpx;
	}

	.Sharecoupons_fd0_0_c0_c01111222222 {
		background: red;
		height: 80rpx;
		border-radius: 50rpx;
		width: 260rpx;
	}

	.Sharecoupons_fd0_0_c0_c011113333 {
		color: #FFFFFF;
	}

	//
	.Sharecoupons_flex_2_hiae00123 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(50rpx + var(--window-bottom));
	}
</style>